package cn.melon.window;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToggleButton;

import cn.melon.helper.BufferedImageHelper;
import cn.melon.helper.ICacheHelper;
import cn.melon.helper.MemCacheHelper;
import cn.melon.mod.dorm.DormInfo;
import cn.melon.mod.home.HomeInfo;
import cn.melon.mod.library.LibraryBooksInfo;
import cn.melon.mod.login.UserInfo;
import cn.melon.mod.roll.RollInfo;
import cn.melon.mod.sc.ScInfo;
import cn.melon.mod.store.entity.GoodsInfo;
import cn.melon.view.JCircleLabel;
import cn.melon.view.JDataLabel;
import cn.melon.view.JDormitoryLabel;
import cn.melon.view.JGoodsPanel;
import cn.melon.view.JImgButton;
import cn.melon.view.JImgChangeButton;
import cn.melon.view.JImgPanel;
import cn.melon.view.JLessonLabel;
import cn.melon.view.JLibraryLabel;
import cn.melon.view.JRollLabel;
import cn.melon.view.JStoreLabel;
import cn.melon.view.JTranslucentPanel;
import cn.melon.view.control.ChangeToSubSubWindow;
import cn.melon.view.control.ChangeToSubWindow;
import cn.melon.view.control.CheckSaftyOfUser;
import cn.melon.view.control.ChooseLesson;
import cn.melon.view.control.CloseWindowEventListener;
import cn.melon.view.control.LendBookLonger;
import cn.melon.view.control.MinWindowEventListener;
import cn.melon.view.control.MouseDraggedAdapter;
import cn.melon.view.control.MouseLocationAdapter;
import cn.melon.view.control.OnMouseOver;
import cn.melon.view.control.OpenRollModificationWindow;

/**
 * @ClassName: MainWindow
 * @author Hzy
 * 主页面类，包含除登录页面外所有页面的初始化界面函数和更新界面函数
 */


/**
 * @ClassName: MainWindow
 * @author Hzy
 * @Description: TODO
 */
/**
 * @ClassName: MainWindow
 * @author Hzy
 * @Description: TODO
 */
public class MainWindow extends JFrame {
    final private int WINDOW_WIDTH = 935;// 含阴影的界面尺寸
    final private int WINDOW_HEIGHT = 608;
    final private int ACTUAL_WINDOW_WIDTH = 921;// 实际界面的尺寸（不计阴影）
    final private int ACTUAL_WINDOW_HEIGHT = 594;
    final private int IMG_WINDOW_WIDTH = 935;// 上部界面的总尺寸
    final private int IMG_WINDOW_HEIGHT = 529;
    final private int WIDGET_WINDOW_WIDTH = 935;// 底部选项按钮的总尺寸
    final private int WIDGET_WINDOW_HEIGHT = 79;
    final private int HEAD_RADIUS = 50;// 头像的半径
    final private int ROLL_HEAD_RADIUS = 50;// 学籍页面头像的半径
    final private int OPTION_WIDTH = 154;// 界面选项按钮的尺寸
    final private int OPTION_HEIGHT = 72;
    final private Color transparent = new Color(0, 0, 0, 0);

    private UserInfo student;
    private HomeInfo userHomeInfo;
    private RollInfo userRollInfo = new RollInfo();
    private DormInfo userDormInfo;
    // 判断是否已初始化界面
    private boolean homeWindowInitialized = false;
    private boolean rollWindowInitialized = false;
    private boolean libraryWindowInitialized = false;
    private boolean storeWindowInitialized = false;
    private boolean lessonWindowInitialized = false;
    private boolean dormitoryWindowInitialized = false;

    private CardLayout card, storeCard, lessonCard;// 分别是底部切换界面/商店/课程界面的卡片布局

    // 组件
    private JCircleLabel head;// 主页的头像
    private JCircleLabel rollHead;// 学籍页面的头像
    private JImgButton home, roll, library, store, lesson, dormitory; // 界面选项按钮
    private JImgPanel homeWindow, rollWindow, libraryWindow, storeWindow, lessonWindow, dormitoryWindow;// 各个界面的JPanel
    // Home页信息控件
    private JLabel lentBookNum, dormitoryCost, cardBalance;
    private JDataLabel leftLesson, morningExerciseTimes;
    // 学籍页面的信息控件
    private JRollLabel rollTitle, rollUpdateDate, personalMotto, basicInfoTip, name, sex, nation, studentNumber,
            cardNum, politicalStatus, maritalStatus, idCard, nativePlace, dateBirth, address, rollInfoTip, curCampus,
            department, major, curGrade, length, phone, email;
    // 图书页面的控件
    private JScrollPane libraryInfoPanel;
    private JPanel libraryInfoPanel_content;// 图书信息的内容容器
    private JPanel libraryInfoPanel_Title;// 图书信息内容页的标题（ID、书名、责任者、借阅日期、应还日期）
    private int libraryInfoPanel_content_height;
    // 商店页面的控件
    private JTranslucentPanel everydayUsePanel, stationeryPanel, snacksPanel, referenceBooksPanel;
    // 课程页面的控件
    private JTranslucentPanel lessonTablePanel, chooseLessonPanel;
    private JPanel lessonTableContentPanel, lessonTableTitlePanel, chooseLessonContentPanel, chooseLessonTitlePanel;
    private JPanel Mon, Tue, Wed, Thr, Fri;
    private Color TableTitleColor = new Color(189, 195, 196);// 皎月
    private Color cellColor = new Color(149, 155, 156);
    // 宿舍页面的控件
    private JDormitoryLabel roommateNum, latestDormitoryMark, dormitoryID, recentHonor;
    // 图书等页面具有相同布局的参数
    final Dimension leftBtnSize = new Dimension(110, 55);// 统一所有页面左部选择栏按钮的size
    final Color leftBtnFontColor = new Color(116, 108, 120);// 页面左部选择栏按钮文字颜色
    final Color leftBtnBorderColor = new Color(200, 200, 200);// 页面左部选择按钮边框颜色
    final Color leftBtnOriginBacColor = new Color(226, 220, 246);// 页面左部选择栏按钮本身颜色
    final Color rightInfoPanelBacColor = new Color(1f, 1f, 1f, .9f);// 页面右部信息栏背景颜色
    // 底部选择控件组
    private ButtonGroup btnGroup;
    private ButtonGroup libraryBtnGroup;
    private ButtonGroup storeBtnGroup;
    private ButtonGroup lessonBtnGroup;

    // 文件路径变量
    private String bacPath = "";
    private String bacWithoutShadow = "";
    private String iconPath = "";
    private String headPath = "";
    private String minPath = "";
    private String closePath = "";
    private String homeGray = "";
    private String homePurple = "";
    private String rollGray = "";
    private String rollPurple = "";
    private String libraryGray = "";
    private String libraryPurple = "";
    private String storeGray = "";
    private String storePurple = "";
    private String lessonGray = "";
    private String lessonPurple = "";
    private String dormitoryGray = "";
    private String dormitoryPurple = "";
    private String rollOver = "";
    private String billImgPath = "";
    private String bookImgPath = "";
    private String coinsImgPath = "";
    private String checkBtnImgPath = "";
    private String jwcNotifyImgPath = "";
    private String jwcNotifyOnHover = "";
    private String campusActivitiesImgPath = "";
    private String campusActivitiesOnHover = "";
    private String mediaSEUImgPath = "";
    private String mediaSEUOnHover = "";
    private String departmentNotifyImgPath = "";
    private String departmentNotifyOnHover = "";
    private String openGitImgPath = "";
    private String openGitOnHover = "";
    private String modifyBtnImgPath = "";
    private String shoppingCartImgPath = "";
    private String shoppingCartOnHover = "";
    private String rocketImgPath = "";
    private String roommateImgPath = "";
    private String dormitoryMarkImgPath = "";

    /**
     * 构造函数，初始化基本控件，调用主页和Home页的初始化函数
     * @param student 用户信息
     */
    public MainWindow(UserInfo student) {
        this.student = student;
        this.card = new CardLayout();
        this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
        this.setLocationRelativeTo(null);// 打开时自动相对于屏幕居中
        this.setUndecorated(true); // 无边框，无标题栏
        this.setResizable(false);
        // this.getRollInfo();

        // 读取文件路径
        try {
            ClassLoader classLoader = getClass().getClassLoader();
            String pathTmp; // 路径临时变量

            bacPath = "/img/bac-img-ex-s.png";
            bacWithoutShadow = "/img/bac-img-ex.png";
            iconPath = "/img/melon-icon-20.png";
            headPath = "/img/head.jpg";
            minPath = "/img/min.png";
            closePath = "/img/close.png";
            homeGray = "/img/home-gray.png";
            homePurple = "/img/home-purple.png";
            rollGray = "/img/roll-gray.png";
            rollPurple = "/img/roll-purple.png";
            libraryGray = "/img/library-gray.png";
            libraryPurple = "/img/library-purple.png";
            storeGray = "/img/store-gray.png";
            storePurple = "/img/store-purple.png";
            lessonGray = "/img/lesson-gray.png";
            lessonPurple = "/img/lesson-purple.png";
            dormitoryGray = "/img/dormitory-gray.png";
            dormitoryPurple = "/img/dormitory-purple.png";
            rollOver = "/img/rollOver.png";
            billImgPath = "/img/bill.png";
            bookImgPath = "/img/book.png";
            coinsImgPath = "/img/coins.png";
            checkBtnImgPath = "/img/check-button.png";
            jwcNotifyImgPath = "/img/教务通知.png";
            jwcNotifyOnHover = "/img/教务通知-onhover.png";
            campusActivitiesImgPath = "/img/校园活动.png";
            campusActivitiesOnHover = "/img/校园活动-onhover.png";
            mediaSEUImgPath = "/img/媒体东大.png";
            mediaSEUOnHover = "/img/媒体东大-onhover.png";
            departmentNotifyImgPath = "/img/院系通知.png";
            departmentNotifyOnHover = "/img/院系通知-onhover.png";
            openGitImgPath = "/img/瓜田项目主页.png";
            openGitOnHover = "/img/瓜田项目主页-onhover.png";
            modifyBtnImgPath = "/img/修改按钮.png";
            shoppingCartImgPath = "/img/购物车icon-35.png";
            shoppingCartOnHover = "/img/购物车icon-35-red.png";
            rocketImgPath = "/img/Rocket.png";
            roommateImgPath = "/img/室友icon.png";
            dormitoryMarkImgPath = "/img/卫生评分icon.png";

            // pathTmp =
            // classLoader.getResource("img/bac-img-ex-s.png").getFile();
            // bacPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/bac-img-ex.png").getFile();
            // bacWithoutShadow = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/melon-icon-20.png").getFile();
            // iconPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/head.jpg").getFile();
            // headPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/min.png").getFile();
            // minPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/close.png").getFile();
            // closePath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/home-gray.png").getFile();
            // homeGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/home-purple.png").getFile();
            // homePurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/roll-gray.png").getFile();
            // rollGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/roll-purple.png").getFile();
            // rollPurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/library-gray.png").getFile();
            // libraryGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/library-purple.png").getFile();
            // libraryPurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/store-gray.png").getFile();
            // storeGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/store-purple.png").getFile();
            // storePurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/lesson-gray.png").getFile();
            // lessonGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/lesson-purple.png").getFile();
            // lessonPurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/dormitory-gray.png").getFile();
            // dormitoryGray = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/dormitory-purple.png").getFile();
            // dormitoryPurple = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/rollOver.png").getFile();
            // rollOver = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/bill.png").getFile();
            // billImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/book.png").getFile();
            // bookImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/coins.png").getFile();
            // coinsImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/check-button.png").getFile();
            // checkBtnImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/教务通知.png").getFile();
            // jwcNotifyImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/教务通知-onhover.png").getFile();
            // jwcNotifyOnHover = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/校园活动.png").getFile();
            // campusActivitiesImgPath = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp =
            // classLoader.getResource("img/校园活动-onhover.png").getFile();
            // campusActivitiesOnHover = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp = classLoader.getResource("img/媒体东大.png").getFile();
            // mediaSEUImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/媒体东大-onhover.png").getFile();
            // mediaSEUOnHover = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/院系通知.png").getFile();
            // departmentNotifyImgPath = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp =
            // classLoader.getResource("img/院系通知-onhover.png").getFile();
            // departmentNotifyOnHover = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp = classLoader.getResource("img/瓜田项目主页.png").getFile();
            // openGitImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/瓜田项目主页-onhover.png").getFile();
            // openGitOnHover = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/修改按钮.png").getFile();
            // modifyBtnImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp =
            // classLoader.getResource("img/购物车icon-35.png").getFile();
            // shoppingCartImgPath = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp =
            // classLoader.getResource("img/购物车icon-35-red.png").getFile();
            // shoppingCartOnHover = java.net.URLDecoder.decode(pathTmp,
            // "utf-8");
            // pathTmp = classLoader.getResource("img/rocket.png").getFile();
            // rocketImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/室友icon.png").getFile();
            // roommateImgPath = java.net.URLDecoder.decode(pathTmp, "utf-8");
            // pathTmp = classLoader.getResource("img/卫生评分icon.png").getFile();
            // dormitoryMarkImgPath= java.net.URLDecoder.decode(pathTmp,
            // "utf-8");

        } catch (Exception e) {
            e.printStackTrace();
        }
        // 主界面
        // 为窗口设置背景
        JImgPanel bacimgWindow = new JImgPanel(bacPath, WINDOW_WIDTH, WINDOW_HEIGHT);// 用于承载背景的JPanel
        this.setBackground(new Color(0, 0, 0, 0));// 设置JFrame背景色透明
        this.getContentPane().add(bacimgWindow);
        // 底部选项栏
        int gap = 8; // icon和文字之间的距离
        Color originColor = new Color(121, 127, 148);// 文字颜色
        Color changedColor = new Color(128, 69, 230);// 变色后的文字颜色
        Color originBacColor = new Color(244, 242, 253);// 按钮原先背景颜色
        Color changedBacColor = new Color(233, 231, 242);// 鼠标放上去之后的背景颜色
        Font f = new Font("宋体", Font.PLAIN, 18);// 文字样式
        // 按钮初始化
        home = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, homeGray, homePurple, "主页", f, gap, originColor,
                changedColor, originBacColor, changedBacColor);
        roll = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, rollGray, rollPurple, "学籍", f, gap, originColor,
                changedColor, originBacColor, changedBacColor);
        library = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, libraryGray, libraryPurple, "图书", f, gap, originColor,
                changedColor, originBacColor, changedBacColor);
        store = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, storeGray, storePurple, "商店", f, gap, originColor,
                changedColor, originBacColor, changedBacColor);
        lesson = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, lessonGray, lessonPurple, "课程", f, gap, originColor,
                changedColor, originBacColor, changedBacColor);
        dormitory = new JImgButton(OPTION_WIDTH, OPTION_HEIGHT, dormitoryGray, dormitoryPurple, "宿舍", f, gap,
                originColor, changedColor, originBacColor, changedBacColor);
        // 添加到ButtonGroup中
        btnGroup = new ButtonGroup();
        btnGroup.add(home);
        btnGroup.add(roll);
        btnGroup.add(library);
        btnGroup.add(store);
        btnGroup.add(lesson);
        btnGroup.add(dormitory);
        btnGroup.setSelected(home.getModel(), true);// 主界面默认选中
        // 为每个按钮在鼠标移动到之上/被选中时设置响应
        home.addMouseListener(new OnMouseOver(home, btnGroup));
        roll.addMouseListener(new OnMouseOver(roll, btnGroup));
        library.addMouseListener(new OnMouseOver(library, btnGroup));
        store.addMouseListener(new OnMouseOver(store, btnGroup));
        lesson.addMouseListener(new OnMouseOver(lesson, btnGroup));
        dormitory.addMouseListener(new OnMouseOver(dormitory, btnGroup));
        // 各个界面的JPanel统一设置
        Dimension s = new Dimension(ACTUAL_WINDOW_WIDTH, IMG_WINDOW_HEIGHT - 7);
        homeWindow = new JImgPanel(s, bacWithoutShadow);
        rollWindow = new JImgPanel(s, bacWithoutShadow);
        libraryWindow = new JImgPanel(s, bacWithoutShadow);
        storeWindow = new JImgPanel(s, bacWithoutShadow);
        lessonWindow = new JImgPanel(s, bacWithoutShadow);
        dormitoryWindow = new JImgPanel(s, bacWithoutShadow);

        // 主界面布局
        JPanel mainWindow = new JPanel();
        mainWindow.setPreferredSize(s);
        mainWindow.setLayout(card);
        mainWindow.add(homeWindow, "homeWindow");
        mainWindow.add(rollWindow, "rollWindow");
        mainWindow.add(libraryWindow, "libraryWindow");
        mainWindow.add(storeWindow, "storeWindow");
        mainWindow.add(lessonWindow, "lessonWindow");
        mainWindow.add(dormitoryWindow, "dormitoryWindow");
        // 添加卡片和按钮
        JPanel mainWindowTopMargin = new JPanel();
        mainWindowTopMargin.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 7));
        mainWindowTopMargin.setBackground(transparent);
        bacimgWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        bacimgWindow.add(mainWindowTopMargin);
        bacimgWindow.add(mainWindow);
        bacimgWindow.add(home);
        bacimgWindow.add(roll);
        bacimgWindow.add(library);
        bacimgWindow.add(store);
        bacimgWindow.add(lesson);
        bacimgWindow.add(dormitory);
        // 添加切换页面的功能
        home.addActionListener(new ChangeToSubWindow(card, mainWindow, "homeWindow"));
        roll.addActionListener(new ChangeToSubWindow(card, mainWindow, "rollWindow"));
        library.addActionListener(new ChangeToSubWindow(card, mainWindow, "libraryWindow"));
        store.addActionListener(new ChangeToSubWindow(card, mainWindow, "storeWindow"));
        lesson.addActionListener(new ChangeToSubWindow(card, mainWindow, "lessonWindow"));
        dormitory.addActionListener(new ChangeToSubWindow(card, mainWindow, "dormitoryWindow"));
        // 为窗口添加拖动
        MouseLocationAdapter m = new MouseLocationAdapter();
        this.addMouseListener(m);
        this.addMouseMotionListener(new MouseDraggedAdapter(this, m.getOriginPoint()));
        // 初始化userInfo

        this.displayHomeWindow();
        userHomeInfo = new HomeInfo();
        initHomeWindow();
        this.setHomeWindowInitialized(true);
    }

    /**
     * @Title: initHomeWindow
     * 初始化主页
     */
    private void initHomeWindow() {
        ICacheHelper helper = new MemCacheHelper();
        userHomeInfo.setLentBookNum(helper.getCache("cur_lent"));
        userHomeInfo.setCardBalance(helper.getCache("card_left"));
        userHomeInfo.setDormitoryCost(helper.getCache("dorm_we"));
        userHomeInfo.setMorningExerciseTimes(helper.getCache("exercise"));
        userHomeInfo.setLeftLessonNum(helper.getCache("course_need"));
        updateHomeWindow();
    }

    /**
     * @Title: displayHomeWindow
     * 初始化Home页面
     */
    public void displayHomeWindow() {
        // Home页面
        userHomeInfo = new HomeInfo("5", "56.82", "150.5", "3", "36");
        final int HOME_HEAD_RADIUS = 40;// home页面头像半径
        final int SMALL_ICON_SIZE = 30;// 三个小图标的直径
        final int CHECK_BUTTON_WIDTH = 195;
        final int CHECK_BUTTON_HEIGHT = 70;
        final int OPEN_GIT_BUTTON_WIDTH = 230;
        final int OPEN_GIT_BUTTON_HEIGHT = 194;
        // 标题栏
        // JLabel softwareIcon = new JLabel(new ImageIcon(iconPath));
        JLabel softwareIcon = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        // JButton minIcon = new JButton(new ImageIcon(minPath));
        JButton minIcon = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));
        minIcon.setPreferredSize(new Dimension(28, 28));
        minIcon.setContentAreaFilled(false);
        minIcon.setBorderPainted(false);
        minIcon.setFocusPainted(false);
        minIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        // JButton closeIcon = new JButton(new ImageIcon(closePath));
        JButton closeIcon = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon.setPreferredSize(new Dimension(28, 28));
        closeIcon.setContentAreaFilled(false);
        closeIcon.setBorderPainted(false);
        closeIcon.setFocusPainted(false);
        closeIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon.addActionListener(new MinWindowEventListener(this));
        closeIcon.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName = new JLabel("瓜田v1.0");
        softwareName.setForeground(Color.white);
        softwareName.setFont(new java.awt.Font("微软雅黑", 0, 13));
        // 头像
        head = new JCircleLabel(HEAD_RADIUS, headPath);
        head.setPreferredSize(new Dimension(2 * HEAD_RADIUS, 2 * HEAD_RADIUS));
        head = new JCircleLabel(HOME_HEAD_RADIUS, headPath);
        JLabel homeTitle = new JLabel("一键检查，掌握校园生活");

        JLabel lentBookIcon = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), bookImgPath)));// 借阅数量前的图书icon
        lentBookNum = new JLabel(userHomeInfo.getLentBookNum());// 当前借阅数量
        JLabel dormitoryCostIcon = new JLabel(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), billImgPath)));// 宿舍待缴水电费前的账单icon
        dormitoryCost = new JLabel(userHomeInfo.getDormitoryCost());// 当前宿舍待缴水电费
        JLabel balanceIcon = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), coinsImgPath)));// 一卡通余额前的金币icon
        cardBalance = new JLabel(userHomeInfo.getCardBalance());// 当前一卡通余额
        // cardBalance = new JLabel("130.5");//当前一卡通余额
        JImgChangeButton checkButton = new JImgChangeButton(CHECK_BUTTON_WIDTH, CHECK_BUTTON_HEIGHT, bacPath,
                checkBtnImgPath, checkBtnImgPath, this);// check按钮
        // JLabel控件的设置
        head.setPreferredSize(new Dimension(2 * HOME_HEAD_RADIUS, 2 * HOME_HEAD_RADIUS));

        // JLabel lentBookIcon = new JLabel(new ImageIcon(bookImgPath));//
        // 借阅数量前的图书icon
        // lentBookNum = new JLabel(userHomeInfo.getLentBookNum());// 当前借阅数量
        // JLabel dormitoryCostIcon = new JLabel(new ImageIcon(billImgPath));//
        // 宿舍待缴水电费前的账单icon
        // dormitoryCost = new JLabel(userHomeInfo.getDormitoryCost());//
        // 当前宿舍待缴水电费
        // JLabel balanceIcon = new JLabel(new ImageIcon(coinsImgPath));//
        // 一卡通余额前的金币icon
        // cardBalance = new JLabel(userHomeInfo.getCardBalance());// 当前一卡通余额
        // JImgChangeButton checkButton = new
        // JImgChangeButton(CHECK_BUTTON_WIDTH, CHECK_BUTTON_HEIGHT, bacPath,
        // checkBtnImgPath, checkBtnImgPath, this);// check按钮
        // // JLabel控件的设置
        // head.setPreferredSize(new Dimension(2 * HOME_HEAD_RADIUS, 2 *
        // HOME_HEAD_RADIUS));

        homeTitle.setForeground(Color.white);
        lentBookNum.setForeground(Color.white);
        dormitoryCost.setForeground(Color.white);
        cardBalance.setForeground(Color.white);
        homeTitle.setFont(new Font("微软雅黑", 0, 18));
        lentBookNum.setFont(new Font("微软雅黑", 0, 12));
        dormitoryCost.setFont(new Font("微软雅黑", 0, 12));
        cardBalance.setFont(new Font("微软雅黑", 0, 12));
        // Icon的设置
        lentBookIcon.setPreferredSize(new Dimension(SMALL_ICON_SIZE, SMALL_ICON_SIZE));
        dormitoryCostIcon.setPreferredSize(new Dimension(SMALL_ICON_SIZE, SMALL_ICON_SIZE));
        balanceIcon.setPreferredSize(new Dimension(SMALL_ICON_SIZE, SMALL_ICON_SIZE));
        // Check按钮的设置
        checkButton.setContentAreaFilled(false);
        checkButton.setPreferredSize(new Dimension(CHECK_BUTTON_WIDTH, CHECK_BUTTON_HEIGHT));
        checkButton.setBorder(null);
        checkButton.setFocusPainted(false);
        checkButton.addActionListener(new CheckSaftyOfUser());
        // 带链接的按钮组
        String gitHomePage = "https://git.oschina.net/corvo/melon/tree/master";
        String jwcPage = "http://jwc.seu.edu.cn";
        String campusActivitiesPage = "http://www.seu.edu.cn/138/list.htm";
        String mediaSEUPage = "http://www.seu.edu.cn/124/list.htm";
        String departmentPage = "http://cse.seu.edu.cn";
        JImgChangeButton jwcNotifyButton = new JImgChangeButton(OPEN_GIT_BUTTON_WIDTH, OPEN_GIT_BUTTON_HEIGHT / 2,
                bacPath, jwcNotifyImgPath, jwcNotifyOnHover, jwcPage, this);
        JImgChangeButton campusActivitiesButton = new JImgChangeButton(OPEN_GIT_BUTTON_WIDTH,
                OPEN_GIT_BUTTON_HEIGHT / 2, bacPath, campusActivitiesImgPath, campusActivitiesOnHover,
                campusActivitiesPage, this);
        JImgChangeButton mediaSEUButton = new JImgChangeButton(OPEN_GIT_BUTTON_WIDTH, OPEN_GIT_BUTTON_HEIGHT / 2,
                bacPath, mediaSEUImgPath, mediaSEUOnHover, mediaSEUPage, this);
        JImgChangeButton departmentNotifyButton = new JImgChangeButton(OPEN_GIT_BUTTON_WIDTH,
                OPEN_GIT_BUTTON_HEIGHT / 2, bacPath, departmentNotifyImgPath, departmentNotifyOnHover, departmentPage,
                this);
        JImgChangeButton openGitButton = new JImgChangeButton(OPEN_GIT_BUTTON_WIDTH, OPEN_GIT_BUTTON_HEIGHT, bacPath,
                openGitImgPath, openGitOnHover, gitHomePage, this);
        // X门待上课程和X次跑操
        // public JDataLabel(int width,int height,String data,String unit,String
        // name,Font dataFont,Font wordFont,Color color,String bacPath){
        Font dataFont = new Font("微软雅黑", Font.PLAIN, 60);
        Font wordFont = new Font("微软雅黑", Font.PLAIN, 13);
        leftLesson = new JDataLabel(OPEN_GIT_BUTTON_WIDTH, OPEN_GIT_BUTTON_HEIGHT / 2, userHomeInfo.getLeftLessonNum(),
                "门", "今日待上课程", dataFont, wordFont, Color.WHITE, bacPath, this);
        morningExerciseTimes = new JDataLabel(OPEN_GIT_BUTTON_WIDTH, OPEN_GIT_BUTTON_HEIGHT / 2,
                userHomeInfo.getMorningExerciseTimes(), "次", "早起勤奋的跑操", dataFont, wordFont, Color.WHITE, bacPath, this);
        // HOME页布局
        JPanel homeTitlePanel = new JPanel();
        JPanel homeMiddlePanel = new JPanel();
        JPanel homeBottomPanel = new JPanel();
        homeTitlePanel.setBackground(transparent);
        homeMiddlePanel.setBackground(transparent);
        // homeMiddlePanel.setBackground(Color.RED);
        homeBottomPanel.setBackground(transparent);
        // homeBottomPanel.setBackground(Color.BLUE);
        homeTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 45));// 38+7(阴影部分的高度)
        homeMiddlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 290));
        homeBottomPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, OPEN_GIT_BUTTON_HEIGHT));
        homeTitlePanel.setBorder(null);
        homeMiddlePanel.setBorder(null);
        homeBottomPanel.setBorder(null);
        // 标题栏布局
        BoxLayout homeTitleLayout = new BoxLayout(homeTitlePanel, BoxLayout.Y_AXIS);
        homeTitlePanel.setLayout(homeTitleLayout);
        Box homeTitle_topMarginBox = Box.createHorizontalBox();
        homeTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        homeTitlePanel.add(homeTitle_topMarginBox);
        Box homeTitle_baseBox = Box.createHorizontalBox();
        homeTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        homeTitle_baseBox.add(softwareIcon);
        homeTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        homeTitle_baseBox.add(softwareName);
        homeTitle_baseBox.add(Box.createGlue());
        homeTitle_baseBox.add(minIcon);
        homeTitle_baseBox.add(closeIcon);
        homeTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        homeTitlePanel.add(homeTitle_baseBox);
        homeTitlePanel.revalidate();
        // 中间部分布局
        homeMiddlePanel.setLayout(new GridBagLayout());
        FontMetrics metrics = homeTitle.getFontMetrics(homeTitle.getFont());
        int homeTitle_width = metrics.stringWidth(homeTitle.getText());
        int homeTitle_height = metrics.getHeight();
        metrics = lentBookNum.getFontMetrics(lentBookNum.getFont());
        int homeInfo_width = metrics.stringWidth("000.00");
        int homeInfo_height = metrics.getHeight();
        int homeMiddlePanel_topMargin = 20;
        GridBagConstraints gbc = new GridBagConstraints();
        // head
        gbc.weighty = 1;
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 2;
        gbc.weightx = 2 * HEAD_RADIUS / homeTitle_width;
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-30, 47, 0, 43);
        homeMiddlePanel.add(head, gbc);
        // homeTitle
        gbc.weighty = homeTitle_height / (2 * HEAD_RADIUS);
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.gridwidth = 6;
        gbc.gridheight = 1;
        gbc.weightx = 1;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(100, 0, 12, 0);
        homeMiddlePanel.add(homeTitle, gbc);
        // 一卡通余额图标
        gbc.weighty = SMALL_ICON_SIZE / (2 * HEAD_RADIUS);
        gbc.gridx = 1;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = SMALL_ICON_SIZE / (homeTitle_width);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 8);
        homeMiddlePanel.add(balanceIcon, gbc);
        // 一卡通余额
        gbc.weighty = SMALL_ICON_SIZE / (2 * HEAD_RADIUS);
        gbc.gridx = 2;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = homeInfo_width / (homeTitle_width);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 25);
        homeMiddlePanel.add(cardBalance, gbc);
        // 宿舍待缴费用图标
        gbc.weighty = SMALL_ICON_SIZE / homeTitle_height;
        gbc.gridx = 3;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = SMALL_ICON_SIZE / (2 * homeTitle_width);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 8);
        homeMiddlePanel.add(dormitoryCostIcon, gbc);
        // 宿舍待缴费用
        gbc.weighty = SMALL_ICON_SIZE / homeTitle_height;
        gbc.gridx = 4;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = homeInfo_width / (2 * HEAD_RADIUS);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 25);
        homeMiddlePanel.add(dormitoryCost, gbc);
        // 借书数目图标
        gbc.weighty = SMALL_ICON_SIZE / homeTitle_height;
        gbc.gridx = 5;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = SMALL_ICON_SIZE / (homeTitle_width);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 8);
        homeMiddlePanel.add(lentBookIcon, gbc);
        // 借书数目
        gbc.weighty = SMALL_ICON_SIZE / homeTitle_height;
        gbc.gridx = 6;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = homeInfo_width / (homeTitle_width);
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-135, 0, 0, 25);
        homeMiddlePanel.add(lentBookNum, gbc);
        // check按钮
        gbc.weighty = CHECK_BUTTON_HEIGHT / (2 * HEAD_RADIUS);
        gbc.gridx = 7;
        gbc.gridy = 0;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.gridheight = 2;
        gbc.anchor = GridBagConstraints.EAST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(-10, 0, 0, 41);
        homeMiddlePanel.add(checkButton, gbc);
        // 底部按钮布局
        homeBottomPanel.setLayout(new GridBagLayout());
        // 项目主页按钮
        gbc.weightx = 1;
        gbc.weighty = 1;
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 2;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        gbc.insets = new Insets(0, 0, 0, 0);
        homeBottomPanel.add(openGitButton, gbc);
        // 今日待上课程
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.anchor = GridBagConstraints.CENTER;
        homeBottomPanel.add(leftLesson, gbc);
        // 教务通知
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.gridx = 2;
        gbc.gridy = 0;
        homeBottomPanel.add(jwcNotifyButton, gbc);
        // 媒体东大
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.gridx = 3;
        gbc.gridy = 0;
        homeBottomPanel.add(mediaSEUButton, gbc);
        // 跑操次数
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.gridx = 1;
        gbc.gridy = 1;
        homeBottomPanel.add(morningExerciseTimes, gbc);
        // 校园活动
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.gridx = 2;
        gbc.gridy = 1;
        homeBottomPanel.add(campusActivitiesButton, gbc);
        // 院系通知
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.gridx = 3;
        gbc.gridy = 1;
        homeBottomPanel.add(departmentNotifyButton, gbc);

        homeWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        homeWindow.add(homeTitlePanel);
        homeWindow.add(homeMiddlePanel);
        homeWindow.add(homeBottomPanel);

    }

    /**
     * @Title: displayRollWindow
     * 初始化学籍页面
     */
    public void displayRollWindow() {
        // 学籍页面
        // 学籍页面标题栏控件
        // JLabel softwareIcon_roll = new JLabel(new ImageIcon(iconPath));
        // JButton minIcon_roll = new JButton(new ImageIcon(minPath));
        //
        JLabel softwareIcon_roll = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        JButton minIcon_roll = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));

        minIcon_roll.setPreferredSize(new Dimension(28, 28));
        minIcon_roll.setContentAreaFilled(false);
        minIcon_roll.setBorderPainted(false);
        minIcon_roll.setFocusPainted(false);
        minIcon_roll.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        // JButton closeIcon_roll = new JButton(new ImageIcon(closePath));
        JButton closeIcon_roll = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon_roll.setPreferredSize(new Dimension(28, 28));
        closeIcon_roll.setContentAreaFilled(false);
        closeIcon_roll.setBorderPainted(false);
        closeIcon_roll.setFocusPainted(false);
        closeIcon_roll.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon_roll.addActionListener(new MinWindowEventListener(this));
        closeIcon_roll.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName_roll = new JLabel("瓜田v1.0");
        softwareName_roll.setForeground(Color.white);
        softwareName_roll.setFont(new java.awt.Font("微软雅黑", 0, 13));

        // 其它控件
        rollTitle = new JRollLabel("个人学籍管理");
        rollTitle.setForeground(Color.WHITE);
        rollTitle.setFont(new Font("微软雅黑", Font.BOLD, 20));
        rollUpdateDate = new JRollLabel("更新日期: " + "2016-08-25 21:23");
        rollUpdateDate.setForeground(Color.WHITE);
        personalMotto = new JRollLabel("个性签名: " + "我很丑但我很温柔");
        personalMotto.setForeground(Color.WHITE);
        JRollLabel basicInfo = new JRollLabel("基础信息");
        basicInfo.setForeground(new Color(26, 15, 30));
        basicInfo.setFont(new Font("微软雅黑", Font.BOLD, 19));
        basicInfoTip = new JRollLabel("有1项信息仍需要完善");
        basicInfoTip.setForeground(new Color(135, 135, 135));
        basicInfoTip.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        name = new JRollLabel("姓名: " + "黄子尧");
        sex = new JRollLabel("性别: " + "男");
        nation = new JRollLabel("民族: " + "汉族");
        studentNumber = new JRollLabel("学号: " + "09014333");
        cardNum = new JRollLabel("一卡通号: " + "213141474");
        politicalStatus = new JRollLabel("政治面貌: " + "共青团员");
        maritalStatus = new JRollLabel("婚姻状况: " + "未知");
        idCard = new JRollLabel("学号: " + "09014333");
        nativePlace = new JRollLabel("籍贯: " + "重庆市丰都县");
        dateBirth = new JRollLabel("出生日期: " + "1997-05-08");
        address = new JRollLabel("家庭住址: " + "重庆市丰都县三合街道XX路X支路XX号XX-X");
        JRollLabel rollInfo = new JRollLabel("学籍信息");
        rollInfo.setForeground(new Color(26, 15, 30));
        rollInfo.setFont(new Font("微软雅黑", Font.BOLD, 19));
        rollInfoTip = new JRollLabel("所有信息均完善");
        rollInfoTip.setForeground(new Color(135, 135, 135));
        rollInfoTip.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        curCampus = new JRollLabel("校区: " + "九龙湖");
        department = new JRollLabel("院系: " + "计算机科学与工程学院");
        major = new JRollLabel("专业: " + "计算机科学与技术");
        curGrade = new JRollLabel("当前年级: " + "大三");
        length = new JRollLabel("学制: " + "四年制");
        phone = new JRollLabel("手机号码: " + "15651823356");
        email = new JRollLabel("电子邮箱: " + "seuhuangziyao@outlook.com");
        rollHead = new JCircleLabel(ROLL_HEAD_RADIUS, headPath);
        rollHead.setPreferredSize(new Dimension(2 * ROLL_HEAD_RADIUS, 2 * ROLL_HEAD_RADIUS));

        JButton basicInfoModifyButton = new JButton("修 改");
        JButton rollInfoModifyButton = new JButton("修 改");
        basicInfoModifyButton.addActionListener(new OpenRollModificationWindow());
        rollInfoModifyButton.addActionListener(new OpenRollModificationWindow());
        basicInfoModifyButton.setMinimumSize(new Dimension(77, 23));
        basicInfoModifyButton.setMaximumSize(new Dimension(77, 23));
        basicInfoModifyButton.setBackground(new Color(48, 216, 131));
        basicInfoModifyButton.setForeground(Color.WHITE);
        basicInfoModifyButton.setFont(new Font("黑体", Font.PLAIN, 13));
        basicInfoModifyButton.setFocusPainted(false);
        rollInfoModifyButton.setMinimumSize(new Dimension(77, 23));
        rollInfoModifyButton.setMaximumSize(new Dimension(77, 23));
        rollInfoModifyButton.setBackground(new Color(48, 216, 131));
        rollInfoModifyButton.setForeground(Color.WHITE);
        rollInfoModifyButton.setFont(new Font("黑体", Font.PLAIN, 13));
        rollInfoModifyButton.setFocusPainted(false);

        // 标题栏布局
        JPanel rollTitlePanel = new JPanel();
        rollTitlePanel.setBackground(transparent);
        rollTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 38));
        rollTitlePanel.setBorder(null);
        BoxLayout rollTitleLayout = new BoxLayout(rollTitlePanel, BoxLayout.Y_AXIS);
        rollTitlePanel.setLayout(rollTitleLayout);
        Box rollTitle_topMarginBox = Box.createHorizontalBox();
        rollTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        rollTitlePanel.add(rollTitle_topMarginBox);
        Box rollTitle_baseBox = Box.createHorizontalBox();
        rollTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        rollTitle_baseBox.add(softwareIcon_roll);
        rollTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        rollTitle_baseBox.add(softwareName_roll);
        rollTitle_baseBox.add(Box.createGlue());
        rollTitle_baseBox.add(minIcon_roll);
        rollTitle_baseBox.add(closeIcon_roll);
        rollTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        rollTitlePanel.add(rollTitle_baseBox);

        rollWindow.setLayout(null);
        JPanel rollTopPanel = new JPanel();
        JPanel basicInfoPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
        JPanel rollInfoPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
        rollTopPanel.setBounds(0, 0, ACTUAL_WINDOW_WIDTH, 147);
        rollHead.setBounds((ACTUAL_WINDOW_WIDTH - 2 * ROLL_HEAD_RADIUS) / 2,
                rollTopPanel.getHeight() - ROLL_HEAD_RADIUS, 2 * ROLL_HEAD_RADIUS, 2 * ROLL_HEAD_RADIUS);
        basicInfoPanel.setBounds(0, 0 + rollTopPanel.getHeight(), ACTUAL_WINDOW_WIDTH, 189);
        rollInfoPanel.setBounds(0, 0 + rollTopPanel.getHeight() + basicInfoPanel.getHeight(), ACTUAL_WINDOW_WIDTH, 193);
        // 学籍界面上半部分
        rollTopPanel.setLayout(new BoxLayout(rollTopPanel, BoxLayout.Y_AXIS));
        rollTopPanel.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 5)));
        rollTopPanel.add(rollTitle_baseBox);
        rollTopPanel.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        Box rollTitleBox = Box.createHorizontalBox();
        rollTitleBox.add(Box.createRigidArea(new Dimension(47, 12)));
        rollTitleBox.add(rollTitle);
        rollTitleBox.add(Box.createHorizontalGlue());
        rollTopPanel.add(rollTitleBox);
        Box rollUpdateDateBox = Box.createHorizontalBox();
        rollUpdateDateBox.add(Box.createRigidArea(new Dimension(47, 12)));
        rollUpdateDateBox.add(rollUpdateDate);
        rollUpdateDateBox.add(Box.createHorizontalGlue());
        rollTopPanel.add(rollUpdateDateBox);
        Box personalMottoBox = Box.createHorizontalBox();
        personalMottoBox.add(Box.createRigidArea(new Dimension(47, 12)));
        personalMottoBox.add(personalMotto);
        personalMottoBox.add(Box.createHorizontalGlue());
        rollTopPanel.add(personalMottoBox);
        rollTopPanel.add(Box.createVerticalGlue());// 使个性签名以后的位置撑开
        // 学籍页面基础信息部分
        JPanel basicInfoPanel_topMargin = new JPanel();
        basicInfoPanel_topMargin.setBackground(transparent);
        basicInfoPanel_topMargin.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 30));
        JPanel basicInfoPanel_title = new JPanel();// 基础信息-有X项信息仍需要完善-修改一栏
        basicInfoPanel_title.setBackground(transparent);
        basicInfoPanel_title.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 55));
        basicInfoPanel_title.setLayout(new BoxLayout(basicInfoPanel_title, BoxLayout.X_AXIS));
        basicInfoPanel_title.add(Box.createRigidArea(new Dimension(47, 60)));
        basicInfoPanel_title.add(basicInfo);
        Box basicInfoTipBox = Box.createVerticalBox();
        basicInfoTipBox.add(Box.createRigidArea(new Dimension(20, 10)));
        basicInfoTipBox.add(basicInfoTip);
        basicInfoPanel_title.add(basicInfoTipBox);
        basicInfoPanel_title.add(Box.createHorizontalGlue());
        basicInfoPanel_title.add(basicInfoModifyButton);
        basicInfoPanel_title.add(Box.createRigidArea(new Dimension(31, 60)));
        JPanel basicInfoPanel_info = new JPanel(new FlowLayout(FlowLayout.LEFT, 47, 5));// 基础信息的内容栏
        basicInfoPanel_info.setBackground(transparent);
        basicInfoPanel_info
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, basicInfoPanel.getHeight() - 30 - 55 - 20));
        basicInfoPanel_info.add(name);
        basicInfoPanel_info.add(sex);
        basicInfoPanel_info.add(nation);
        basicInfoPanel_info.add(studentNumber);
        basicInfoPanel_info.add(cardNum);
        basicInfoPanel_info.add(politicalStatus);
        basicInfoPanel_info.add(maritalStatus);
        basicInfoPanel_info.add(idCard);
        basicInfoPanel_info.add(nativePlace);
        basicInfoPanel_info.add(dateBirth);
        basicInfoPanel_info.add(address);
        JPanel basicInfoPanel_bottom = new JPanel();// 底部的内边距
        basicInfoPanel_bottom.setBackground(transparent);
        basicInfoPanel_bottom.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 20));
        basicInfoPanel.add(basicInfoPanel_topMargin);
        basicInfoPanel.add(basicInfoPanel_title);
        basicInfoPanel.add(basicInfoPanel_info);
        basicInfoPanel.add(basicInfoPanel_bottom);
        // 学籍页面学籍信息部分
        JPanel rollInfoPanel_topMargin = new JPanel();
        rollInfoPanel_topMargin.setBackground(transparent);
        rollInfoPanel_topMargin.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 30));
        JPanel rollInfoPanel_title = new JPanel();// 学籍信息-有X项信息仍需要完善-修改一栏
        rollInfoPanel_title.setBackground(transparent);
        rollInfoPanel_title.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 55));
        rollInfoPanel_title.setLayout(new BoxLayout(rollInfoPanel_title, BoxLayout.X_AXIS));
        rollInfoPanel_title.add(Box.createRigidArea(new Dimension(47, 60)));
        rollInfoPanel_title.add(rollInfo);
        Box rollInfoTipBox = Box.createVerticalBox();
        rollInfoTipBox.add(Box.createRigidArea(new Dimension(20, 10)));
        rollInfoTipBox.add(rollInfoTip);
        rollInfoPanel_title.add(rollInfoTipBox);
        rollInfoPanel_title.add(Box.createHorizontalGlue());
        rollInfoPanel_title.add(rollInfoModifyButton);
        rollInfoPanel_title.add(Box.createRigidArea(new Dimension(31, 60)));
        JPanel rollInfoPanel_info = new JPanel(new FlowLayout(FlowLayout.LEFT, 47, 5));// 基础信息的内容栏
        rollInfoPanel_info.setBackground(transparent);
        rollInfoPanel_info
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, rollInfoPanel.getHeight() - 30 - 55 - 20));
        rollInfoPanel_info.add(curCampus);
        rollInfoPanel_info.add(department);
        rollInfoPanel_info.add(major);
        rollInfoPanel_info.add(curGrade);
        rollInfoPanel_info.add(phone);
        rollInfoPanel_info.add(email);
        JPanel rollInfoPanel_bottom = new JPanel();// 底部的内边距
        rollInfoPanel_bottom.setBackground(transparent);
        rollInfoPanel_bottom.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 20));
        rollInfoPanel.add(rollInfoPanel_topMargin);
        rollInfoPanel.add(rollInfoPanel_title);
        rollInfoPanel.add(rollInfoPanel_info);
        rollInfoPanel.add(rollInfoPanel_bottom);

        rollTopPanel.setBackground(transparent);
        basicInfoPanel.setBackground(rightInfoPanelBacColor);
        basicInfoPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(180, 180, 180)));
        rollInfoPanel.setBackground(rightInfoPanelBacColor);

        rollWindow.add(rollHead);
        rollWindow.add(rollTopPanel);
        rollWindow.add(basicInfoPanel);
        rollWindow.add(rollInfoPanel);

    }

    /**
     * @Title: displayLibraryWindow
     * 初始化图书页面
     */
    public void displayLibraryWindow() {
        // 图书页面
        // 标题栏
        JLabel softwareIcon_library = new JLabel(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        JButton minIcon_library = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));
        minIcon_library.setPreferredSize(new Dimension(28, 28));
        minIcon_library.setContentAreaFilled(false);
        minIcon_library.setBorderPainted(false);
        minIcon_library.setFocusPainted(false);
        minIcon_library.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        JButton closeIcon_library = new JButton(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon_library.setPreferredSize(new Dimension(28, 28));
        closeIcon_library.setContentAreaFilled(false);
        closeIcon_library.setBorderPainted(false);
        closeIcon_library.setFocusPainted(false);
        closeIcon_library.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon_library.addActionListener(new MinWindowEventListener(this));
        closeIcon_library.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName_library = new JLabel("瓜田v1.0");
        softwareName_library.setForeground(Color.white);
        softwareName_library.setFont(new java.awt.Font("微软雅黑", 0, 13));
        JPanel libraryTitlePanel = new JPanel();
        libraryTitlePanel.setBackground(transparent);
        libraryTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 38));
        libraryTitlePanel.setBorder(null);
        BoxLayout libraryTitleLayout = new BoxLayout(libraryTitlePanel, BoxLayout.Y_AXIS);
        libraryTitlePanel.setLayout(libraryTitleLayout);
        Box libraryTitle_topMarginBox = Box.createHorizontalBox();
        libraryTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        libraryTitlePanel.add(libraryTitle_topMarginBox);
        Box libraryTitle_baseBox = Box.createHorizontalBox();
        libraryTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        libraryTitle_baseBox.add(softwareIcon_library);
        libraryTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        libraryTitle_baseBox.add(softwareName_library);
        libraryTitle_baseBox.add(Box.createHorizontalGlue());
        libraryTitle_baseBox.add(minIcon_library);
        libraryTitle_baseBox.add(closeIcon_library);
        libraryTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        libraryTitlePanel.add(libraryTitle_baseBox);
        // 图书页面控件
        JLibraryLabel libraryTitle = new JLibraryLabel("读万卷书，书中自有黄金屋");
        libraryTitle.setForeground(Color.WHITE);
        libraryTitle.setFont(new Font("微软雅黑", Font.PLAIN, 27));
        JToggleButton curLentBtn = new JToggleButton("当前借阅");
        JToggleButton hotLentBtn = new JToggleButton("热门借阅");
        JToggleButton myFavoriteBtn = new JToggleButton("我的收藏");
        libraryBtnGroup = new ButtonGroup();
        libraryBtnGroup.add(curLentBtn);
        libraryBtnGroup.add(hotLentBtn);
        libraryBtnGroup.add(myFavoriteBtn);

        curLentBtn.setPreferredSize(leftBtnSize);
        curLentBtn.setBackground(leftBtnOriginBacColor);
        curLentBtn.setForeground(leftBtnFontColor);
        curLentBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        curLentBtn.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        curLentBtn.setFocusPainted(false);
        hotLentBtn.setPreferredSize(leftBtnSize);
        hotLentBtn.setForeground(leftBtnFontColor);
        hotLentBtn.setBackground(leftBtnOriginBacColor);
        hotLentBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        hotLentBtn.setBorder(null);
        hotLentBtn.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        hotLentBtn.setFocusPainted(false);
        myFavoriteBtn.setPreferredSize(leftBtnSize);
        myFavoriteBtn.setForeground(leftBtnFontColor);
        myFavoriteBtn.setBackground(leftBtnOriginBacColor);
        myFavoriteBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        myFavoriteBtn.setBorder(null);
        myFavoriteBtn.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        myFavoriteBtn.setFocusPainted(false);
        JLibraryLabel bookID = new JLibraryLabel("条码号");
        JLibraryLabel bookNameAndAuthor = new JLibraryLabel("题名/责任者");
        JLibraryLabel lentDate = new JLibraryLabel("借阅日期");
        JLibraryLabel backDate = new JLibraryLabel("应还日期");
        // 图书页面布局
        // 大布局
        JPanel libraryTopPanel = new JPanel();
        JPanel libraryLeftPanel = new JPanel();
        libraryInfoPanel_content = new JPanel();
        libraryInfoPanel = new JScrollPane(libraryInfoPanel_content);
        libraryTopPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 147));
        libraryLeftPanel.setPreferredSize(new Dimension(leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        libraryInfoPanel
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        this.libraryInfoPanel_content_height = 400;
        // 设置定高并且不再更改，是因为当滚动条出现后，拖动会使文字变糊。。。。我是真的真的解决不了这种蛋疼的问题了
        libraryInfoPanel_content
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        libraryInfoPanel_content.revalidate();
        libraryTopPanel.setBackground(transparent);
        libraryLeftPanel.setBackground(new Color(226, 220, 246));
        libraryInfoPanel.getViewport().setBackground(rightInfoPanelBacColor);
        libraryInfoPanel_content.setBackground(rightInfoPanelBacColor);
        libraryInfoPanel.setBorder(null);
        libraryWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        libraryWindow.add(libraryTopPanel);
        libraryWindow.add(libraryLeftPanel);
        libraryWindow.add(libraryInfoPanel);
        // 图书页面顶部布局
        libraryTopPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        libraryTopPanel.add(libraryTitlePanel);
        libraryTitle.setBorder(BorderFactory.createEmptyBorder(25, 0, 0, 0));
        libraryTopPanel.add(libraryTitle);
        // 图书页面侧边栏布局
        libraryLeftPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        libraryLeftPanel.add(curLentBtn);
        libraryLeftPanel.add(hotLentBtn);
        libraryLeftPanel.add(myFavoriteBtn);
        libraryLeftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, leftBtnBorderColor));
        curLentBtn.addMouseListener(new ChangeToSubSubWindow(null, null, ""));
        hotLentBtn.addMouseListener(new ChangeToSubSubWindow(null, null, ""));
        myFavoriteBtn.addMouseListener(new ChangeToSubSubWindow(null, null, ""));
        // 图书页面信息部分布局
        libraryInfoPanel_Title = new JPanel();
        libraryInfoPanel_Title.setBackground(transparent);
        libraryInfoPanel_Title.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
        libraryInfoPanel_Title.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, 20 + 10));
        libraryInfoPanel_Title.setLayout(new BoxLayout(libraryInfoPanel_Title, BoxLayout.X_AXIS));
        libraryInfoPanel_Title.add(Box.createRigidArea(new Dimension(64, 20)));
        libraryInfoPanel_Title.add(bookID);
        libraryInfoPanel_Title.add(Box.createRigidArea(new Dimension(56, 20)));
        libraryInfoPanel_Title.add(bookNameAndAuthor);
        libraryInfoPanel_Title.add(Box.createHorizontalGlue());
        libraryInfoPanel_Title.add(lentDate);
        libraryInfoPanel_Title.add(Box.createRigidArea(new Dimension(75, 20)));
        libraryInfoPanel_Title.add(backDate);
        libraryInfoPanel_Title.add(Box.createRigidArea(new Dimension(190, 20)));
        libraryInfoPanel_content.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 20));
        // libraryInfoPanel_content.setBackground(Color.RED);
        libraryInfoPanel_content.add(libraryInfoPanel_Title);
        // 添加测试书目
        LibraryBooksInfo bookTest = new LibraryBooksInfo();
        bookTest.setBookID("2679885");
        bookTest.setBookName("汉书今注");
        bookTest.setAuthor("班固");
        bookTest.setBorrowDate("2016-06-27");
        bookTest.setReturnDate("2016-09-10");
        this.addLentBook(bookTest);
        this.addLentBook(bookTest);
        this.addLentBook(bookTest);
        this.addLentBook(bookTest);
        this.addLentBook(bookTest);
        this.addLentBook(bookTest);
        this.removeAllBooks();
        this.addLentBook(bookTest);
    }

    /**
     * @Title: displayStoreWindow
     * 初始化商店界面
     */
    public void displayStoreWindow() {
        // 标题栏
        JLabel softwareIcon_store = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        JButton minIcon_store = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));
        minIcon_store.setPreferredSize(new Dimension(28, 28));
        minIcon_store.setContentAreaFilled(false);
        minIcon_store.setBorderPainted(false);
        minIcon_store.setFocusPainted(false);
        minIcon_store.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        JButton closeIcon_store = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon_store.setPreferredSize(new Dimension(28, 28));
        closeIcon_store.setContentAreaFilled(false);
        closeIcon_store.setBorderPainted(false);
        closeIcon_store.setFocusPainted(false);
        closeIcon_store.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon_store.addActionListener(new MinWindowEventListener(this));
        closeIcon_store.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName_store = new JLabel("瓜田v1.0");
        softwareName_store.setForeground(Color.white);
        softwareName_store.setFont(new java.awt.Font("微软雅黑", 0, 13));
        JPanel storeTitlePanel = new JPanel();
        storeTitlePanel.setBackground(transparent);
        storeTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 38));
        storeTitlePanel.setBorder(null);
        BoxLayout storeTitleLayout = new BoxLayout(storeTitlePanel, BoxLayout.Y_AXIS);
        storeTitlePanel.setLayout(storeTitleLayout);
        Box storeTitle_topMarginBox = Box.createHorizontalBox();
        storeTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        storeTitlePanel.add(storeTitle_topMarginBox);
        Box storeTitle_baseBox = Box.createHorizontalBox();
        storeTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        storeTitle_baseBox.add(softwareIcon_store);
        storeTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        storeTitle_baseBox.add(softwareName_store);
        storeTitle_baseBox.add(Box.createHorizontalGlue());
        storeTitle_baseBox.add(minIcon_store);
        storeTitle_baseBox.add(closeIcon_store);
        storeTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        storeTitlePanel.add(storeTitle_baseBox);
        // 商店页面控件
        JStoreLabel storeTitle = new JStoreLabel("买得到的校园生活");
        storeTitle.setForeground(Color.WHITE);
        storeTitle.setFont(new Font("微软雅黑", Font.PLAIN, 27));
        JToggleButton everydayUse = new JToggleButton("日用百货");
        JToggleButton stationery = new JToggleButton("学习用具");
        JToggleButton snacks = new JToggleButton("零食饮料");
        JToggleButton referenceBooks = new JToggleButton("学习资料");
        // JButton shoppingCart = new JButton(new
        // ImageIcon(shoppingCartImgPath));//购物车按钮
        JImgChangeButton shoppingCart = new JImgChangeButton(35, 35, bacPath, shoppingCartImgPath, shoppingCartOnHover,
                this);
        storeBtnGroup = new ButtonGroup();
        storeBtnGroup.add(everydayUse);
        storeBtnGroup.add(stationery);
        storeBtnGroup.add(snacks);
        storeBtnGroup.add(referenceBooks);

        everydayUse.setPreferredSize(leftBtnSize);
        everydayUse.setBackground(leftBtnOriginBacColor);
        everydayUse.setForeground(leftBtnFontColor);
        everydayUse.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        everydayUse.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        everydayUse.setFocusPainted(false);
        stationery.setPreferredSize(leftBtnSize);
        stationery.setForeground(leftBtnFontColor);
        stationery.setBackground(leftBtnOriginBacColor);
        stationery.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        stationery.setBorder(null);
        stationery.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        stationery.setFocusPainted(false);
        snacks.setPreferredSize(leftBtnSize);
        snacks.setForeground(leftBtnFontColor);
        snacks.setBackground(leftBtnOriginBacColor);
        snacks.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        snacks.setBorder(null);
        snacks.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        snacks.setFocusPainted(false);
        referenceBooks.setPreferredSize(leftBtnSize);
        referenceBooks.setForeground(leftBtnFontColor);
        referenceBooks.setBackground(leftBtnOriginBacColor);
        referenceBooks.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        referenceBooks.setBorder(null);
        referenceBooks.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        referenceBooks.setFocusPainted(false);
        // 商店页面布局
        // 大布局
        JPanel storeTopPanel = new JPanel();
        JPanel storeLeftPanel = new JPanel();
        JPanel storeRightPanel = new JPanel();
        storeRightPanel
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        storeTopPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 147));
        storeLeftPanel.setPreferredSize(new Dimension(leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        storeTopPanel.setBackground(transparent);
        storeLeftPanel.setBackground(new Color(226, 220, 246));
        storeWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        storeWindow.add(storeTopPanel);
        storeWindow.add(storeLeftPanel);
        storeWindow.add(storeRightPanel);
        everydayUsePanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147,
                bacPath, new Color(1f, 1f, 1f, .9f));
        stationeryPanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147,
                bacPath, new Color(1f, 1f, 1f, .9f));
        snacksPanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147,
                bacPath, new Color(1f, 1f, 1f, .9f));
        referenceBooksPanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width,
                IMG_WINDOW_HEIGHT - 7 - 147, bacPath, new Color(1f, 1f, 1f, .9f));
        storeCard = new CardLayout();
        storeRightPanel.setLayout(storeCard);
        storeRightPanel.add(everydayUsePanel, "everydayUsePanel");
        storeRightPanel.add(stationeryPanel, "stationeryPanel");
        storeRightPanel.add(snacksPanel, "snacksPanel");
        storeRightPanel.add(referenceBooksPanel, "referenceBooksPanel");

        // 图书页面顶部布局
        storeTopPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        storeTopPanel.add(storeTitlePanel);
        storeTitle.setBorder(BorderFactory.createEmptyBorder(25, 0, 0, 0));
        storeTopPanel.add(storeTitle);
        JPanel shoppingCartLine = new JPanel();
        storeTopPanel.add(shoppingCartLine);
        shoppingCartLine.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 35));
        shoppingCartLine.setBackground(transparent);
        shoppingCartLine.setLayout(new FlowLayout(FlowLayout.RIGHT, 20, 0));
        shoppingCartLine.add(shoppingCart);
        // 图书页面侧边栏布局
        storeLeftPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        storeLeftPanel.add(everydayUse);
        storeLeftPanel.add(stationery);
        storeLeftPanel.add(snacks);
        storeLeftPanel.add(referenceBooks);
        storeLeftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, leftBtnBorderColor));

        everydayUse.setSelected(true);
        everydayUse.addMouseListener(new ChangeToSubSubWindow(storeCard, storeRightPanel, "everydayUsePanel"));
        stationery.addMouseListener(new ChangeToSubSubWindow(storeCard, storeRightPanel, "stationeryPanel"));
        snacks.addMouseListener(new ChangeToSubSubWindow(storeCard, storeRightPanel, "snacksPanel"));
        referenceBooks.addMouseListener(new ChangeToSubSubWindow(storeCard, storeRightPanel, "referenceBooksPanel"));
        // 商品页面信息部分布局
        FlowLayout storeInfoLayout = new FlowLayout(FlowLayout.LEFT, 30, 13);
        everydayUsePanel.setLayout(storeInfoLayout);
        stationeryPanel.setLayout(storeInfoLayout);
        snacksPanel.setLayout(storeInfoLayout);
        referenceBooksPanel.setLayout(storeInfoLayout);
        // 测试商品
        GoodsInfo book1 = new GoodsInfo();
        book1.setGoodsName("Java从入门到放弃");
        book1.setGoodsPrice(32.5);
        book1.setGoodsSales(347);
        JGoodsPanel book1Panel = new JGoodsPanel(book1);
        everydayUsePanel.add(book1Panel);
        GoodsInfo book2 = new GoodsInfo();
        book2.setGoodsName("C++从入门到放弃");
        book2.setGoodsPrice(42.5);
        book2.setGoodsSales(300);
        JGoodsPanel book2Panel = new JGoodsPanel(book2);
        stationeryPanel.add(book2Panel);
        GoodsInfo book3 = new GoodsInfo();
        book3.setGoodsName("Python从入门到放弃");
        book3.setGoodsPrice(41.5);
        book3.setGoodsSales(20);
        JGoodsPanel book3Panel = new JGoodsPanel(book3);
        snacksPanel.add(book3Panel);
        GoodsInfo book4 = new GoodsInfo();
        book4.setGoodsName("颈椎病康复指南");
        book4.setGoodsPrice(41.5);
        book4.setGoodsSales(999);
        JGoodsPanel book4Panel = new JGoodsPanel(book4);
        referenceBooksPanel.add(book4Panel);
    }

    /**
     * 初始化课程页面
     * @Title: displayLessonWindow
     */
    public void displayLessonWindow() {
        // 标题栏
        JLabel softwareIcon_lesson = new JLabel(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        JButton minIcon_lesson = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));
        minIcon_lesson.setPreferredSize(new Dimension(28, 28));
        minIcon_lesson.setContentAreaFilled(false);
        minIcon_lesson.setBorderPainted(false);
        minIcon_lesson.setFocusPainted(false);
        minIcon_lesson.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        JButton closeIcon_lesson = new JButton(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon_lesson.setPreferredSize(new Dimension(28, 28));
        closeIcon_lesson.setContentAreaFilled(false);
        closeIcon_lesson.setBorderPainted(false);
        closeIcon_lesson.setFocusPainted(false);
        closeIcon_lesson.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon_lesson.addActionListener(new MinWindowEventListener(this));
        closeIcon_lesson.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName_lesson = new JLabel("瓜田v1.0");
        softwareName_lesson.setForeground(Color.white);
        softwareName_lesson.setFont(new java.awt.Font("微软雅黑", 0, 13));
        JPanel lessonTitlePanel = new JPanel();
        lessonTitlePanel.setBackground(transparent);
        lessonTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 38));
        lessonTitlePanel.setBorder(null);
        BoxLayout lessonTitleLayout = new BoxLayout(lessonTitlePanel, BoxLayout.Y_AXIS);
        lessonTitlePanel.setLayout(lessonTitleLayout);
        Box lessonTitle_topMarginBox = Box.createHorizontalBox();
        lessonTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        lessonTitlePanel.add(lessonTitle_topMarginBox);
        Box lessonTitle_baseBox = Box.createHorizontalBox();
        lessonTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        lessonTitle_baseBox.add(softwareIcon_lesson);
        lessonTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        lessonTitle_baseBox.add(softwareName_lesson);
        lessonTitle_baseBox.add(Box.createHorizontalGlue());
        lessonTitle_baseBox.add(minIcon_lesson);
        lessonTitle_baseBox.add(closeIcon_lesson);
        lessonTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        lessonTitlePanel.add(lessonTitle_baseBox);
        // 课程页面控件
        JLessonLabel lessonTitle = new JLessonLabel("业精于勤，荒于嬉");
        lessonTitle.setForeground(Color.WHITE);
        lessonTitle.setFont(new Font("微软雅黑", Font.PLAIN, 27));
        JToggleButton findLessonTable = new JToggleButton("查询课表");
        JToggleButton chooseLesson = new JToggleButton("选择课程");
        lessonBtnGroup = new ButtonGroup();
        lessonBtnGroup.add(findLessonTable);
        lessonBtnGroup.add(chooseLesson);

        findLessonTable.setPreferredSize(leftBtnSize);
        findLessonTable.setBackground(leftBtnOriginBacColor);
        findLessonTable.setForeground(leftBtnFontColor);
        findLessonTable.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        findLessonTable.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        findLessonTable.setFocusPainted(false);
        chooseLesson.setPreferredSize(leftBtnSize);
        chooseLesson.setForeground(leftBtnFontColor);
        chooseLesson.setBackground(leftBtnOriginBacColor);
        chooseLesson.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        chooseLesson.setBorder(null);
        chooseLesson.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, leftBtnBorderColor));
        chooseLesson.setFocusPainted(false);
        // 课程页面布局
        // 大布局
        JPanel lessonTopPanel = new JPanel();
        JPanel lessonLeftPanel = new JPanel();
        JPanel lessonRightPanel = new JPanel();
        lessonRightPanel
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        lessonTopPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 147));
        lessonLeftPanel.setPreferredSize(new Dimension(leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147));
        lessonTopPanel.setBackground(transparent);
        lessonLeftPanel.setBackground(new Color(226, 220, 246));
        lessonWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        lessonWindow.add(lessonTopPanel);
        lessonWindow.add(lessonLeftPanel);
        lessonWindow.add(lessonRightPanel);
        lessonTablePanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147,
                bacPath, new Color(1f, 1f, 1f, .9f));
        chooseLessonPanel = new JTranslucentPanel(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 147,
                bacPath, new Color(1f, 1f, 1f, .9f));
        lessonCard = new CardLayout();
        lessonRightPanel.setLayout(lessonCard);
        lessonRightPanel.add(lessonTablePanel, "lessonTablePanel");
        lessonRightPanel.add(chooseLessonPanel, "chooseLessonPanel");

        // 课程页面顶部布局
        lessonTopPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        lessonTopPanel.add(lessonTitlePanel);
        lessonTitle.setBorder(BorderFactory.createEmptyBorder(25, 0, 0, 0));
        lessonTopPanel.add(lessonTitle);
        // 课程页面侧边栏布局
        lessonLeftPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        lessonLeftPanel.add(findLessonTable);
        lessonLeftPanel.add(chooseLesson);
        lessonLeftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, leftBtnBorderColor));

        findLessonTable.setSelected(true);
        findLessonTable.addMouseListener(new ChangeToSubSubWindow(this, lessonCard, lessonRightPanel, "lessonTablePanel"));
        chooseLesson.addMouseListener(new ChangeToSubSubWindow(this, lessonCard, lessonRightPanel, "chooseLessonPanel"));
        // 选择课程界面
        JPanel termSelectionPanel_chooseLesson = new JPanel();
        termSelectionPanel_chooseLesson.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, 76));
        termSelectionPanel_chooseLesson
                .setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(180, 180, 180)));
        termSelectionPanel_chooseLesson.setLayout(new FlowLayout(FlowLayout.LEFT, 31, 25));
        chooseLessonContentPanel = new JPanel();
        chooseLessonContentPanel
                .setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, IMG_WINDOW_HEIGHT - 7 - 76));
        chooseLessonContentPanel.setBackground(transparent);
        chooseLessonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
        chooseLessonPanel.add(termSelectionPanel_chooseLesson);
        chooseLessonPanel.add(chooseLessonContentPanel);
        // 选择学期部分
        JLessonLabel termSelectionLabel_chooseLesson = new JLessonLabel("选择学期");
        JComboBox termSelectionBox_chooseLesson = new JComboBox();
        termSelectionBox_chooseLesson.addItem("2016-17第2学期");
        termSelectionPanel_chooseLesson.add(termSelectionLabel_chooseLesson);
        termSelectionPanel_chooseLesson.add(termSelectionBox_chooseLesson);
        // 选课部分
        chooseLessonTitlePanel = new JPanel();
        chooseLessonTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31, 30));
        chooseLessonTitlePanel.setBackground(transparent);
        chooseLessonTitlePanel.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 0.4405;
        gbc.weighty = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        chooseLessonTitlePanel.add(new JLessonLabel("选择课程", Font.BOLD), gbc);

        gbc.gridx++;
        gbc.weightx = 0.8987;
        chooseLessonTitlePanel.add(new JLessonLabel("课程名称/教师", Font.BOLD), gbc);

        gbc.gridx++;
        gbc.weightx = 1;
        chooseLessonTitlePanel.add(new JLessonLabel("上课时间", Font.BOLD), gbc);

        gbc.gridx++;
        gbc.weightx = 1.1762;
        gbc.insets = new Insets(0, 15, 0, 0);
        chooseLessonTitlePanel.add(new JLessonLabel("上课地点", Font.BOLD), gbc);

        chooseLessonContentPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 31, 15));
        chooseLessonContentPanel.add(chooseLessonTitlePanel);

        ScInfo testLesson = new ScInfo();
        testLesson.setClassNumber("2679885");
        testLesson.setClassName("IOS应用开发");
        testLesson.setClassTeacher("乔布斯");
        testLesson.setClassTime("1-8周/周一1-2,周五3-4");
        testLesson.setClassroom("九龙湖J1-302");
        this.addLessonToChooseLessonWindow(testLesson);
        // 课表界面
        JPanel termSelectionPanel_lessonTable = new JPanel();
        termSelectionPanel_lessonTable.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, 76));
        // termSelectionPanel_lessonTable.setBorder(BorderFactory.createMatteBorder(0,
        // 0, 1, 0, new Color(180,180,180)));
        termSelectionPanel_lessonTable.setLayout(new FlowLayout(FlowLayout.LEFT, 31, 25));
        lessonTableContentPanel = new JPanel();
        lessonTableContentPanel.setPreferredSize(
                new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31 * 2, IMG_WINDOW_HEIGHT - 7 - 147 - 76));
        lessonTableContentPanel.setBackground(transparent);
        lessonTablePanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        lessonTablePanel.add(termSelectionPanel_lessonTable);
        lessonTablePanel.add(lessonTableContentPanel);
        // 选择学期部分
        JLessonLabel termSelectionLabel_lessonTable = new JLessonLabel("选择学期");
        JComboBox termSelectionBox_lessonTable = new JComboBox();
        termSelectionBox_lessonTable.addItem("2016-17第2学期");
        termSelectionPanel_lessonTable.add(termSelectionLabel_lessonTable);
        termSelectionPanel_lessonTable.add(termSelectionBox_lessonTable);
        // 课表部分
        int TableWidth = ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31 * 2;// 表宽度
        int TableHeight = IMG_WINDOW_HEIGHT - 7 -147 - 76;// 表高度
//        int cellWidth = TableWidth / 5; // 单元格宽度
        int cellWidth = 148; // 单元格宽度
//        int cellHeight = TableHeight / 14;// 单元格高度
        int cellHeight = 21;// 单元格高度

        Mon = new JPanel();
        Mon.setPreferredSize(new Dimension(cellWidth, TableHeight));
        Mon.setBackground(transparent);
        Tue = new JPanel();
        Tue.setPreferredSize(new Dimension(cellWidth, TableHeight));
        Tue.setBackground(transparent);
        Wed = new JPanel();
        Wed.setPreferredSize(new Dimension(cellWidth, TableHeight));
        Wed.setBackground(transparent);
        Thr = new JPanel();
        Thr.setPreferredSize(new Dimension(cellWidth, TableHeight));
        Thr.setBackground(transparent);
        Fri = new JPanel();
        Fri.setPreferredSize(new Dimension(cellWidth, TableHeight));
        Fri.setBackground(transparent);
        lessonTableContentPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        lessonTableContentPanel.setBackground(transparent);
        lessonTableContentPanel.add(Mon);
        lessonTableContentPanel.add(Tue);
        lessonTableContentPanel.add(Wed);
        lessonTableContentPanel.add(Thr);
        lessonTableContentPanel.add(Fri);
        // 加入顶部的周X方块
        JPanel MonTitle = new JPanel();
        MonTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        MonTitle.setBackground(TableTitleColor);
        MonTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        MonTitle.setBounds(0, 0, cellWidth, 18);
        MonTitle.add(new JLessonLabel("周一", Color.WHITE));
        Mon.setLayout(null);
        Mon.add(MonTitle);
        JPanel TueTitle = new JPanel();
        TueTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        TueTitle.setBackground(TableTitleColor);
        TueTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        TueTitle.setBounds(0, 0, cellWidth, cellHeight);
        TueTitle.add(new JLessonLabel("周二", Color.WHITE));
        Tue.setLayout(null);
        Tue.add(TueTitle);
        JPanel WedTitle = new JPanel();
        WedTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        WedTitle.setBackground(TableTitleColor);
        WedTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        WedTitle.setBounds(0, 0, cellWidth, cellHeight);
        WedTitle.add(new JLessonLabel("周三", Color.WHITE));
        Wed.setLayout(null);
        Wed.add(WedTitle);
        JPanel ThrTitle = new JPanel();
        ThrTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        ThrTitle.setBackground(TableTitleColor);
        ThrTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        ThrTitle.setBounds(0, 0, cellWidth, cellHeight);
        ThrTitle.add(new JLessonLabel("周四", Color.WHITE));
        Thr.setLayout(null);
        Thr.add(ThrTitle);
        JPanel FriTitle = new JPanel();
        FriTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        FriTitle.setBackground(TableTitleColor);
        FriTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        FriTitle.setBounds(0, 0, cellWidth, cellHeight);
        FriTitle.add(new JLessonLabel("周五", Color.WHITE));
        Fri.setLayout(null);
        Fri.add(FriTitle);
        // 加入测试课程到课表
        ScInfo testLesson2 = testLesson;
        testLesson2.setClassTime("星期一-1-2,星期四-4-6");
        this.addLessonToTable(testLesson2);
    }


    /**
     * 初始化宿舍页面
     * @Title: displayDormitoryWindow
     */
    public void displayDormitoryWindow() {
        // 标题栏
        JLabel softwareIcon_dormitory = new JLabel(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), iconPath)));
        JButton minIcon_dormitory = new JButton(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), minPath)));
        minIcon_dormitory.setPreferredSize(new Dimension(28, 28));
        minIcon_dormitory.setContentAreaFilled(false);
        minIcon_dormitory.setBorderPainted(false);
        minIcon_dormitory.setFocusPainted(false);
        minIcon_dormitory.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        JButton closeIcon_dormitory = new JButton(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), closePath)));
        closeIcon_dormitory.setPreferredSize(new Dimension(28, 28));
        closeIcon_dormitory.setContentAreaFilled(false);
        closeIcon_dormitory.setBorderPainted(false);
        closeIcon_dormitory.setFocusPainted(false);
        closeIcon_dormitory.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        minIcon_dormitory.addActionListener(new MinWindowEventListener(this));
        closeIcon_dormitory.addActionListener(new CloseWindowEventListener(this));
        JLabel softwareName_dormitory = new JLabel("瓜田v1.0");
        softwareName_dormitory.setForeground(Color.white);
        softwareName_dormitory.setFont(new java.awt.Font("微软雅黑", 0, 13));
        JPanel dormitoryTitlePanel = new JPanel();
        dormitoryTitlePanel.setBackground(transparent);
        dormitoryTitlePanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH, 38));
        dormitoryTitlePanel.setBorder(null);
        BoxLayout dormitoryTitleLayout = new BoxLayout(dormitoryTitlePanel, BoxLayout.Y_AXIS);
        dormitoryTitlePanel.setLayout(dormitoryTitleLayout);
        Box dormitoryTitle_topMarginBox = Box.createHorizontalBox();
        dormitoryTitle_topMarginBox.add(Box.createRigidArea(new Dimension(ACTUAL_WINDOW_WIDTH, 10)));
        dormitoryTitlePanel.add(dormitoryTitle_topMarginBox);
        Box dormitoryTitle_baseBox = Box.createHorizontalBox();
        dormitoryTitle_baseBox.add(Box.createRigidArea(new Dimension(13, 38)));
        dormitoryTitle_baseBox.add(softwareIcon_dormitory);
        dormitoryTitle_baseBox.add(Box.createRigidArea(new Dimension(5, 38)));
        dormitoryTitle_baseBox.add(softwareName_dormitory);
        dormitoryTitle_baseBox.add(Box.createHorizontalGlue());
        dormitoryTitle_baseBox.add(minIcon_dormitory);
        dormitoryTitle_baseBox.add(closeIcon_dormitory);
        dormitoryTitle_baseBox.add(Box.createRigidArea(new Dimension(15, 38)));
        dormitoryTitlePanel.add(dormitoryTitle_baseBox);
        // 初始对象
        userDormInfo = new DormInfo();
        userDormInfo.setDormNum("梅3A-302");
        userDormInfo.setNewScore("92.5");
        userDormInfo.setNewHonor("最近暂未获得任何荣誉");
        // 宿舍页面控件

        // JLabel rocketImg = new JLabel(new ImageIcon(rocketImgPath));
        JLabel rocketImg = new JLabel(new ImageIcon(this.getClass().getResource(rocketImgPath)));
        rocketImg.setPreferredSize(new Dimension(188, 367));
        // JLabel roommateImg = new JLabel(new ImageIcon(roommateImgPath));
        JLabel roommateImg = new JLabel(new ImageIcon(BufferedImageHelper.getSource(this.getClass(), roommateImgPath)));
        roommateImg.setPreferredSize(new Dimension(76, 76));
        // JLabel dormitoryMarkImg = new JLabel(new
        // ImageIcon(dormitoryMarkImgPath));
        JLabel dormitoryMarkImg = new JLabel(
                new ImageIcon(BufferedImageHelper.getSource(this.getClass(), dormitoryMarkImgPath)));
        dormitoryMarkImg.setPreferredSize(new Dimension(76, 76));
        JDormitoryLabel dormitoryTitle = new JDormitoryLabel("宿舍动态，全面掌握");
        dormitoryTitle.setFont(new Font("微软雅黑", Font.BOLD, 56));
        JDormitoryLabel roommate = new JDormitoryLabel("活泼可爱的室友");
        JDormitoryLabel roommateUnit = new JDormitoryLabel("个");
        JDormitoryLabel dormitoryMark = new JDormitoryLabel("最新卫生评分");
        JDormitoryLabel dormitoryMarkUnit = new JDormitoryLabel("分");
        JTranslucentPanel dormNameAndHonor = new JTranslucentPanel(300, 113, bacPath, new Color(1f, 1f, 1f, 0.5f));// 宿舍名称和最近荣誉的底部半透明背景
        JPanel decorationLine = new JPanel();// 蓝色装饰线条
        decorationLine.setPreferredSize(new Dimension(6, 100));
        decorationLine.setMinimumSize(new Dimension(6, 100));
        decorationLine.setMaximumSize(new Dimension(6, 100));
        decorationLine.setBackground(new Color(38, 100, 210));
        dormitoryID = new JDormitoryLabel(userDormInfo.getDormNum());
        dormitoryID.setFont(new Font("微软雅黑", Font.PLAIN, 52));
        roommateNum = new JDormitoryLabel("3");
        roommateNum.setFont(new Font("微软雅黑", Font.PLAIN, 24));
        latestDormitoryMark = new JDormitoryLabel(userDormInfo.getNewScore());
        latestDormitoryMark.setFont(new Font("微软雅黑", Font.PLAIN, 24));
        recentHonor = new JDormitoryLabel(userDormInfo.getNewHonor());
        recentHonor.setFont(new Font("微软雅黑", Font.PLAIN, 24));
        // 布局
        // 宿舍名称和最近荣誉部件
        dormNameAndHonor.setLayout(new BoxLayout(dormNameAndHonor, BoxLayout.X_AXIS));
        dormNameAndHonor.add(Box.createRigidArea(new Dimension(21, 113)));
        dormNameAndHonor.add(decorationLine);
        dormNameAndHonor.add(Box.createRigidArea(new Dimension(15, 113)));
        Box nameAndHonor = Box.createVerticalBox();
        // nameAndHonor.add(Box.createRigidArea(new Dimension(2,8)));
        nameAndHonor.add(dormitoryID);
        dormitoryID.setAlignmentY(TOP_ALIGNMENT);
        nameAndHonor.add(Box.createVerticalGlue());
        nameAndHonor.add(recentHonor);
        nameAndHonor.add(Box.createRigidArea(new Dimension(2, 8)));
        dormNameAndHonor.add(nameAndHonor);
        // 室友信息
        JPanel roommatePanel = new JPanel();
        roommatePanel.setPreferredSize(new Dimension(206, 76));
        roommatePanel.setBackground(transparent);
        roommatePanel.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 2;
        gbc.weightx = 0.556;
        gbc.weighty = 1;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.CENTER;
        roommatePanel.add(roommateImg, gbc);

        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 0.4;
        gbc.weighty = 0.5;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        JPanel roommateNumAndUnit = new JPanel();
        roommateNumAndUnit.setPreferredSize(new Dimension(70, 30));
        roommateNumAndUnit.setBackground(transparent);
        roommateNumAndUnit.setLayout(new FlowLayout(FlowLayout.LEFT));
        roommateNumAndUnit.add(roommateNum);
        roommateNumAndUnit.add(roommateUnit);
        roommatePanel.add(roommateNumAndUnit, gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 1;
        gbc.weighty = 0.5;
        gbc.insets = new Insets(-15, 5, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        roommatePanel.add(roommate, gbc);

        // 卫生评分
        JPanel dormMarkPanel = new JPanel();
        dormMarkPanel.setPreferredSize(new Dimension(206, 76));
        dormMarkPanel.setBackground(transparent);
        dormMarkPanel.setLayout(new GridBagLayout());
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 2;
        gbc.weightx = 0.556;
        gbc.weighty = 1;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.CENTER;
        dormMarkPanel.add(dormitoryMarkImg, gbc);

        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 0.4;
        gbc.weighty = 0.5;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        JPanel dormMarkAndUnit = new JPanel();
        dormMarkAndUnit.setPreferredSize(new Dimension(80, 30));
        dormMarkAndUnit.setBackground(transparent);
        dormMarkAndUnit.setLayout(new FlowLayout(FlowLayout.LEFT));
        dormMarkAndUnit.add(latestDormitoryMark);
        dormMarkAndUnit.add(dormitoryMarkUnit);
        dormMarkPanel.add(dormMarkAndUnit, gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 1.0;
        gbc.weighty = 0.5;
        gbc.insets = new Insets(0, 5, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        dormMarkPanel.add(dormitoryMark, gbc);
        // 布局
        JPanel dormLeftPanel = new JPanel();
        JPanel dormRightPanel = new JPanel();
        dormLeftPanel.setPreferredSize(new Dimension(353, IMG_WINDOW_HEIGHT - 7 - 38));
        dormRightPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - 353, IMG_WINDOW_HEIGHT - 7 - 38));
        dormitoryWindow.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        dormitoryWindow.add(dormitoryTitlePanel);
        dormitoryWindow.add(dormLeftPanel);
        dormitoryWindow.add(dormRightPanel);
        dormLeftPanel.setBackground(transparent);
        dormRightPanel.setBackground(transparent);
        // 左侧
        dormLeftPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 70));
        dormLeftPanel.add(rocketImg);
        // 右侧
        dormRightPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 52));
        dormitoryTitle.setBorder(BorderFactory.createEmptyBorder(18, 0, 0, 0));
        dormRightPanel.add(dormitoryTitle);
        dormRightPanel.add(roommatePanel);
        JPanel dormRightPanelGap = new JPanel();
        dormRightPanelGap.setPreferredSize(new Dimension(36, 10));
        dormRightPanelGap.setBackground(transparent);
        dormRightPanel.add(dormRightPanelGap);
        dormRightPanel.add(dormMarkPanel);
        dormRightPanel.add(dormNameAndHonor);

    }

    /**
     * @Title: updateHomeWindow
     * 更新Home页视图
     */
    public void updateHomeWindow() {
        // 更新主页视图
        lentBookNum.setText(userHomeInfo.getLentBookNum());
        dormitoryCost.setText(userHomeInfo.getDormitoryCost());
        cardBalance.setText(userHomeInfo.getCardBalance());
        this.repaint();// 需要对JFrame进行重绘，否则新值与旧值会重叠
        leftLesson.setData(userHomeInfo.getLeftLessonNum());
        morningExerciseTimes.setData(userHomeInfo.getMorningExerciseTimes());

    }

    /**
     * @Title: updateRollWindow
     * 更新学籍页视图
     */
    public void updateRollWindow() {
        // 更新学籍页面视图
        // private JRollLabel rollTitle, rollUpdateDate, personalMotto,
        // basicInfoTip, name, sex, nation, studentNumber,
        // cardNum, politicalStatus, martialStatus, idCard, nativePlace,
        // dateBirth, address, rollInfoTip, curCampus,
        // department, major, curGrade, length, phone, email;
        rollUpdateDate.setText(userRollInfo.getUpdateDate());
        personalMotto.setText(userRollInfo.getSign());
        name.setText(userRollInfo.getName());
        sex.setText(userRollInfo.getSex());
        nation.setText(userRollInfo.getNation());
        studentNumber.setText(userRollInfo.getStudentNumber());
        cardNum.setText(userRollInfo.getCardNum());
        politicalStatus.setText(userRollInfo.getPoliticalStatus());
        maritalStatus.setText(userRollInfo.getMaritalStatus());
        idCard.setText(userRollInfo.getIdCard());
        nativePlace.setText(userRollInfo.getNativePlace());
        dateBirth.setText(userRollInfo.getDateBirth());
        address.setText(userRollInfo.getAddress());
        curCampus.setText(userRollInfo.getCurCampus());
        department.setText(userRollInfo.getDepartment());
        major.setText(userRollInfo.getMajor());
        curGrade.setText(userRollInfo.getCurGrade());
        length.setText(userRollInfo.getLength());
        phone.setText(userRollInfo.getPhone());
        email.setText(userRollInfo.getEmail());

        basicInfoTip.setText("所有信息均完整");
        // if(userRollInfo.getBasicInfoLost().equals(0)){
        // basicInfoTip.setText("所有信息均完整");
        // }else{
        // basicInfoTip.setText("有"+userRollInfo.getBasicInfoLost()+"项信息需要完善");
        // }
        // if(userRollInfo.getRollInfoLost().equals(0)){
        // rollInfoTip.setText("所有信息均完整");
        // }else{
        // rollInfoTip.setText("有"+userRollInfo.getBasicInfoLost()+"项信息需要完善");
        // }
        this.validate();
        this.repaint();
    }

    /**
     * @Title: addLentBook
     * 添加一本书到当前借阅的视图中
     * @param book void
     */
    public void addLentBook(LibraryBooksInfo book) {
        // 新建并设置续借按钮控件
        JButton lendLonger = new JButton("续 借");
        lendLonger.setMaximumSize(new Dimension(68, 25));
        lendLonger.setMinimumSize(new Dimension(68, 25));
        lendLonger.setFocusPainted(false);
        lendLonger.setBackground(new Color(48, 216, 131));
        lendLonger.setForeground(Color.WHITE);
        lendLonger.setFont(new Font("微软雅黑", Font.PLAIN, 16));
        lendLonger.addActionListener(new LendBookLonger(student.getStudentNum(), book.getBookID(), this));// 传入学生学号和书籍条码号，通知服务器端用户要求续借
        // 更新视图，加入一本书
        JPanel libraryInfoPanel_book = new JPanel();
        libraryInfoPanel_book.setBackground(transparent);
        libraryInfoPanel_book.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width, 25));
        libraryInfoPanel_book.setLayout(new BoxLayout(libraryInfoPanel_book, BoxLayout.X_AXIS));
        libraryInfoPanel_book.add(Box.createRigidArea(new Dimension(64, 20)));
        libraryInfoPanel_book.add(new JLibraryLabel(book.getBookID()));
        libraryInfoPanel_book.add(Box.createRigidArea(new Dimension(41, 20)));
        String bookName = null;
        String author = null;
        if (book.getBookName().length() > 9) {
            bookName = book.getBookName().substring(0, 9);
        } else {
            bookName = book.getBookName();
        }

        if (book.getAuthor().length() > 5) {
            author = book.getAuthor().substring(0, 5);
        } else {
            author = book.getAuthor();
        }
        libraryInfoPanel_book.add(new JLibraryLabel(bookName + "/" + author));
        libraryInfoPanel_book.add(Box.createHorizontalGlue());
        libraryInfoPanel_book.add(new JLibraryLabel(book.getBorrowDate()));
        libraryInfoPanel_book.add(Box.createRigidArea(new Dimension(55, 20)));
        libraryInfoPanel_book.add(new JLibraryLabel(book.getDDL()));
        libraryInfoPanel_book.add(Box.createRigidArea(new Dimension(65, 20)));
        libraryInfoPanel_book.add(lendLonger);
        libraryInfoPanel_book.add(Box.createRigidArea(new Dimension(32, 20)));
        libraryInfoPanel_content.add(libraryInfoPanel_book);

        this.validate();
        this.repaint();
    }

    /**
     * @Title: removeAllBooks
     * 移除当前借阅视图中的所有书籍
     */
    public void removeAllBooks() {
        // 移除当前所有的书
        libraryInfoPanel_content.removeAll();
        libraryInfoPanel_content.add(libraryInfoPanel_Title);
        this.validate();
        this.repaint();

    }

    /**
     * @Title: addGoods
     * 添加一项商品到对应的分类视图下
     * @param goods void
     */
    public void addGoods(GoodsInfo goods) {
        // 在界面中添加一个货物
        if (goods.getGoodsType().equals("日用百货")) {
            // 日用百货更新
            JGoodsPanel goodsPanel = new JGoodsPanel(goods);
            everydayUsePanel.add(goodsPanel);
        }
        if (goods.getGoodsType().equals("学习用具")) {
            // 学习用具更新请求
            JGoodsPanel goodsPanel = new JGoodsPanel(goods);
            stationeryPanel.add(goodsPanel);
        }
        if (goods.getGoodsType().equals("零食饮料")) {
            // 零食饮料更新请求
            JGoodsPanel goodsPanel = new JGoodsPanel(goods);
            snacksPanel.add(goodsPanel);
        }
        if (goods.getGoodsType().equals("学习资料")) {
            // 学习书籍更新请求
            JGoodsPanel goodsPanel = new JGoodsPanel(goods);
            referenceBooksPanel.add(goodsPanel);
        }
        this.validate();
        this.repaint();
    }

    /**
     * @Title: removeAllGoods
     * 移除某项分类视图下的所有商品
     * @param goodsType void
     */
    public void removeAllGoods(String goodsType) {
        // 移除某一栏下的所有商品
        if (goodsType.equals("日用百货")) {
            // 日用百货重置
            everydayUsePanel.removeAll();
            ;
        }
        if (goodsType.equals("学习用具")) {
            // 学习用具重置请求
            stationeryPanel.removeAll();
        }
        if (goodsType.equals("零食饮料")) {
            // 零食饮料重置请求
            snacksPanel.removeAll();
        }
        if (goodsType.equals("学习资料")) {
            // 学习书籍重置请求
            referenceBooksPanel.removeAll();
        }

        this.validate();
        this.repaint();
    }

    /**
     * @Title: addLessonToTable
     * 添加一门课程到课表中
     * @param lesson void
     */
    public void addLessonToTable(ScInfo lesson) {
        int TableWidth = ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31 * 2;// 表宽度
        int TableHeight = IMG_WINDOW_HEIGHT - 7 -147 - 76;// 表高度
//        int cellWidth = TableWidth / 5; // 单元格宽度
        int cellWidth = 148; // 单元格宽度
//        int cellHeight = TableHeight / 14;// 单元格高度
        int cellHeight = 21;// 单元格高度

        String time = lesson.getClassTime();
        String name = lesson.getClassName();
        String classroom = lesson.getClassroom();
        String[] time_once = time.split(",");// 元素为每次课的时间信息
        for (int n = 0; n < time_once.length; n++) {
            String[] day_begin_end = time_once[n].split("-");// 元素为上课在星期几/从哪节课开始/在哪节课结束
            for (int i = 0; i < day_begin_end.length; i++) {
                String day = day_begin_end[0];
                int begin = Integer.parseInt(day_begin_end[1]);
                int end = Integer.parseInt(day_begin_end[2]);
                // 课表中该次课程的方块设置
                JPanel oneLesson = new JPanel();
                oneLesson.setBorder(BorderFactory.createLineBorder(Color.WHITE));
                oneLesson.setBackground(cellColor);
                oneLesson.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
                oneLesson.setBounds(0, begin * cellHeight, cellWidth, (end - begin + 1) * cellHeight);
                // 课程名称
                JLessonLabel nameLabel = new JLessonLabel(begin + "-" + end + " " + name, Color.WHITE);
                nameLabel.setFont(new Font("微软雅黑",Font.PLAIN,11));
                // 教室
                JLessonLabel roomLabel = new JLessonLabel(classroom, Color.WHITE);
                roomLabel.setFont(new Font("微软雅黑", Font.PLAIN, 11));

                JPanel topMargin = new JPanel();
                topMargin.setPreferredSize(new Dimension(cellWidth, ((end - begin + 1) * cellHeight - 31)));
                topMargin.setBackground(transparent);
                oneLesson.add(topMargin);
                oneLesson.add(roomLabel);
                oneLesson.add(nameLabel);
                if (day.equals("星期一")) {
                    Mon.add(oneLesson);
                }
                if (day.equals("星期二")) {
                    Tue.add(oneLesson);
                }
                if (day.equals("星期三")) {
                    Wed.add(oneLesson);
                }
                if (day.equals("星期四")) {
                    Thr.add(oneLesson);
                }
                if (day.equals("星期五")) {
                    Fri.add(oneLesson);
                }
            }
        }
    }

    /**
     * @Title: removeAllLessonInTable
     * 删除当前课表中的所有课程
     */
    public void removeAllLessonInTable() {
        Mon.removeAll();
        Tue.removeAll();
        Wed.removeAll();
        Thr.removeAll();
        Fri.removeAll();
        // 加入顶部的周X方块
        int TableWidth = ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31 * 2;// 表宽度
        int TableHeight = IMG_WINDOW_HEIGHT - 7 - 76;// 表高度
//      int cellWidth = TableWidth / 5; // 单元格宽度
        int cellWidth = 148; // 单元格宽度
//      int cellHeight = TableHeight / 14;// 单元格高度
        int cellHeight = 21;// 单元格高度

        JPanel MonTitle = new JPanel();
        MonTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        MonTitle.setBackground(TableTitleColor);
        MonTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        MonTitle.setBounds(0, 0, cellWidth, cellHeight);
        MonTitle.add(new JLessonLabel("周一", Color.WHITE));
        Mon.setLayout(null);
        Mon.add(MonTitle);
        JPanel TueTitle = new JPanel();
        TueTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        TueTitle.setBackground(TableTitleColor);
        TueTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        TueTitle.setBounds(0, 0, cellWidth, cellHeight);
        TueTitle.add(new JLessonLabel("周二", Color.WHITE));
        Tue.setLayout(null);
        Tue.add(TueTitle);
        JPanel WedTitle = new JPanel();
        WedTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        WedTitle.setBackground(TableTitleColor);
        WedTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        WedTitle.setBounds(0, 0, cellWidth, cellHeight);
        WedTitle.add(new JLessonLabel("周三", Color.WHITE));
        Wed.setLayout(null);
        Wed.add(WedTitle);
        JPanel ThrTitle = new JPanel();
        ThrTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        ThrTitle.setBackground(TableTitleColor);
        ThrTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        ThrTitle.setBounds(0, 0, cellWidth, cellHeight);
        ThrTitle.add(new JLessonLabel("周四", Color.WHITE));
        Thr.setLayout(null);
        Thr.add(ThrTitle);
        JPanel FriTitle = new JPanel();
        FriTitle.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        FriTitle.setBackground(TableTitleColor);
        FriTitle.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
        FriTitle.setBounds(0, 0, cellWidth, cellHeight);
        FriTitle.add(new JLessonLabel("周五", Color.WHITE));
        Fri.setLayout(null);
        Fri.add(FriTitle);
    }

    /**
     * 添加一门课程到选择课程视图下
     * @Title: addLessonToChooseLessonWindow
     * @param lesson void
     */
    public void addLessonToChooseLessonWindow(ScInfo lesson) {
        JButton chooseLessonBtn = new JButton("选 课");
        chooseLessonBtn.addActionListener(new ChooseLesson(lesson.getClassNumber()));
        chooseLessonBtn.setMinimumSize(new Dimension(77, 23));
        chooseLessonBtn.setMaximumSize(new Dimension(77, 23));
        chooseLessonBtn.setBackground(new Color(48, 216, 131));
        chooseLessonBtn.setForeground(Color.WHITE);
        chooseLessonBtn.setFont(new Font("黑体", Font.PLAIN, 13));
        chooseLessonBtn.setFocusPainted(false);

        JPanel singleLessonPanel = new JPanel();
        singleLessonPanel.setPreferredSize(new Dimension(ACTUAL_WINDOW_WIDTH - leftBtnSize.width - 31, 30));
        singleLessonPanel.setBackground(transparent);
        singleLessonPanel.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 0.4405;
        gbc.weighty = 1;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.insets = new Insets(0, 0, 0, 0);
        gbc.fill = GridBagConstraints.NONE;
        singleLessonPanel.add(new JLessonLabel(lesson.getClassNumber()), gbc);

        gbc.gridx++;
        gbc.weightx = 0.8987;
        gbc.insets = new Insets(0, 38, 0, 35);
        String lessonName;
        if (lesson.getClassName().length() > 5) {
            lessonName = lesson.getClassName().substring(0, 5);
        } else {
            lessonName = lesson.getClassName();
        }
        singleLessonPanel.add(new JLessonLabel(lessonName + "/" + lesson.getClassTeacher()), gbc);

        gbc.gridx++;
        gbc.weightx = 1;
        gbc.insets = new Insets(0, 0, 0, 0);
        singleLessonPanel.add(new JLessonLabel(lesson.getClassTime()), gbc);

        gbc.gridx++;
        gbc.weightx = 0.6916;
        gbc.insets = new Insets(0, 0, 0, 0);
        singleLessonPanel.add(new JLessonLabel(lesson.getClassroom()), gbc);

        gbc.gridx++;
        gbc.weightx = 1.1762 - 0.6916;
        singleLessonPanel.add(chooseLessonBtn, gbc);

        chooseLessonContentPanel.add(singleLessonPanel);
        this.validate();
        this.repaint();

    }

    /**
     * @Title: removeAllLessonsInChooseWindow
     * 移除选择课程视图下的所有课程
     */
    public void removeAllLessonsInChooseWindow() {
        chooseLessonContentPanel.removeAll();
        chooseLessonContentPanel.add(chooseLessonTitlePanel);

    }

    /**
     * @Title: updateDormitoryWindow
     * 更新宿舍页视图
     * @param user void
     */
    public void updateDormitoryWindow(DormInfo user) {
        // roommateNum.setText(text); //默认为3
        latestDormitoryMark.setText(user.getNewScore());
        dormitoryID.setText(user.getDormNum());
        recentHonor.setText(user.getNewHonor());
        this.validate();
        this.repaint();

    }

    public UserInfo getStudent() {
        return student;
    }

    public void setStudent(UserInfo student) {
        this.student = student;
    }

    public boolean isHomeWindowInitialized() {
        return homeWindowInitialized;
    }

    public void setHomeWindowInitialized(boolean homeWindowInitialized) {
        this.homeWindowInitialized = homeWindowInitialized;
    }

    public boolean isRollWindowInitialized() {
        return rollWindowInitialized;
    }

    public void setRollWindowInitialized(boolean rollWindowInitialized) {
        this.rollWindowInitialized = rollWindowInitialized;
    }

    public boolean isLibraryWindowInitialized() {
        return libraryWindowInitialized;
    }

    public void setLibraryWindowInitialized(boolean libraryWindowInitialized) {
        this.libraryWindowInitialized = libraryWindowInitialized;
    }

    public boolean isStoreWindowInitialized() {
        return storeWindowInitialized;
    }

    public void setStoreWindowInitialized(boolean storeWindowInitialized) {
        this.storeWindowInitialized = storeWindowInitialized;
    }

    public boolean isLessonWindowInitialized() {
        return lessonWindowInitialized;
    }

    public void setLessonWindowInitialized(boolean lessonWindowInitialized) {
        this.lessonWindowInitialized = lessonWindowInitialized;
    }

    public boolean isDormitoryWindowInitialized() {
        return dormitoryWindowInitialized;
    }

    public void setDormitoryWindowInitialized(boolean dormitoryWindowInitialized) {
        this.dormitoryWindowInitialized = dormitoryWindowInitialized;
    }

    public HomeInfo getUserHomeInfo() {
        return userHomeInfo;
    }

    public RollInfo getUserRollInfo() {
        return userRollInfo;
    }

    public void setUserHomeInfo(HomeInfo userHomeInfo) {
        this.userHomeInfo = userHomeInfo;
    }

    public void setUserRollInfo(RollInfo userRollInfo) {
        this.userRollInfo = userRollInfo;
    }

    public DormInfo getUserDormInfo() {
        return userDormInfo;
    }

    public void setUserDormInfo(DormInfo userDormInfo) {
        System.out.println(userDormInfo.getNewScore());
        this.userDormInfo = userDormInfo;
    }

    public static void main(String[] args) {
        UserInfo u = new UserInfo();
        MainWindow test = new MainWindow(u);
        test.setVisible(true);
        HomeInfo user = new HomeInfo("4", "46.82", "450.5", "4", "46");
        // test.setHomeInfo(user);
    }
}
